﻿using System;
using Core.DependencyInjection;
using Core.NetWorkUtils;
using DHelpers.ExtensionsHelper;
using DomainModels.DomainModels.JsonModels;
using DomainModels.DomainModels.Systems;

namespace Core.ApiMetods.Abstract
{
    public abstract class BaseMethod
    {
        protected event EventHandler<EventInfoArgs> OnInfo;

        protected readonly IWebHelper WebHelper;

        protected readonly TokenResponse TokenObj;

        protected BaseMethod(TokenResponse tokenObj)
        {
            TokenObj = tokenObj;
            WebHelper = NinjectFactory.Resolve<WebHelper>();
        }

        public abstract BaseEntyti Get(params string[] args);

        protected virtual void Info(object sender, EventInfoArgs e)
        {
            e.Raise(sender, ref OnInfo);
        }
    }
}